<!-- 4 实现附件 中 《全选》文件夹的功能，选中上面，下面都选中，上面不选，下面都不选 -->
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<title>Title</title>
		<style>
			td {
				/* border: 1px solid rebeccapurple; */
				width: 150px;
				border-bottom: 1px dashed darkgray;
				text-align: center;
			}

			thead {
				font-weight: bold;
			}

			.lie3 {
				width: 300px;
			}

			table {
				position: absolute;
				top: 50px;
			}
		</style>
	</head>
	<body>
		<table>
			<img src="image/list_bg.gif" style="width: 770px;" />
			<thead>

				<tr>
					<td><input type="checkbox" id="check">全选</td>
					<td>商品图片</td>
					<td>商品名称/出售者/联系方式</td>
					<td>价格</td>
				</tr>
			</thead>
			<tbody id="tbody">
				<tr>
					<td><input type="checkbox" name="user"></td>
					<td><img src="image/list0.jpg" /></td>
					<td class="lie3">杜比环绕，家庭影院必备，超真实享受<p>出售者：ling112233</p>
						<img src="image/online_pic.gif" />&emsp;<img src="image/list_tool_fav1.gif" />收藏
					</td>
					<td>一口价<br />2833.0</td>
				</tr>
				<tr>
					<td><input type="checkbox" name="user"></td>
					<td><img src="image/list1.jpg" /></td>
					<td>NVDIA 9999GT 512MB 256bit极品显卡<p>出售者：aipiaopiao110</p>
						<img src="image/online_pic.gif" />&emsp;<img src="image/list_tool_fav1.gif" />收藏
					</td>
					<td>一口价<br />6464.0</td>
				</tr>
				<tr>
					<td><input type="checkbox" name="user"></td>
					<td><img src="image/list2.jpg" /></td>
					<td>精品热卖：高清晰，30寸等离子电视<p>出售者：阳光的挣扎</p>
						<img src="image/online_pic.gif" />&emsp;<img src="image/list_tool_fav1.gif" />收藏
					</td>
					<td>一口价<br />18888.0</td>
				</tr>
				<tr>
					<td><input type="checkbox" name="user"></td>
					<td><img src="image/list3.jpg" /></td>
					<td>Sony索尼家用最新款笔记本<p>出售者：疯狂的境无</p>
						<img src="image/online_pic.gif" />&emsp;<img src="image/list_tool_fav1.gif" />收藏
					</td>
					<td>一口价<br />5889.0</td>
				</tr>
			</tbody>
		</table>
	</body>
	<script>
		document.getElementById("check").onclick = function() {
			var checked = document.getElementById("check").checked;
			var checkson = document.getElementsByName("user");
			if (checked) {
				for (var i = 0; i < checkson.length; i++) {
					checkson[i].checked = true;
				}
			} else {
				for (var i = 0; i < checkson.length; i++) {
					checkson[i].checked = false;
				}
			}
		}
	</script>
</html>
